Contact balance GET

URI

https://{DATACENTER}.brightpearlconnect.com/public-api/{ACCOUNT}
/accounting-service/contact/{customerId}/currency/{isoCurrencyCode}/balance[?dateFrom={dateFrom}&dateTo={dateTo}]

Refer to our documentation on URI syntax for more information on how to construct URIs.

Description

Retrieves the balance for a contact (customer or supplier) for a given currency from and up to (including) the specified dates.

If supplied, the dates at which to get the balance must be in the ISO format yyyy-mm-dd.

If there are no transactions for the specified customer and currency code, a null balance will be returned to distinguish from a balance of zero where transactions are present. The existence of the customer and currency code are not explicitly validated so will return HTTP 200 with a null balance.

Example 1

Retrieving the balance for contact 207 and currency GBP up to today

Request URI

/contact/207/currency/GBP/balance

Response

{
	"response": "50.00"
}

Example 2

Retrieving the balance for contact 299 and currency USD up to a specified date

Request URI

/contact/299/currency/USD/balance?dateTo=2017-01-01

Response

{
	"response": "42.00"
}

Example 3

Retrieving the balance for contact 200 and currency USD where there are no transactions

Request URI

/contact/200/currency/USD/balance

Response

{
	"response": null
}

Example 4

Retrieving the balance for contact 200 and currency XYZ which does not exist

Request URI

/contact/200/currency/XYZ/balance

Response

{
	"response": null
}